//
//  EntityBase.h
//  TengineTwo
//
//  Created by StandardUser on 10/02/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
//  update module defines the behaviour (mostly movement) of the entity for timestep T
//  tOffset is a timestamp which is used to offset the object down the timeline - so it can appear later
//  in the game...
//

#import <Foundation/Foundation.h>
#import "Entity.h"
#import "EntityTypes.h"
#import "TengineModel.h"

@class EntityModel;
@protocol UpdateModule <NSObject>

-(void)update:(EntityModel*)e FromT:(float)t;

@end

@protocol EntityModelControllerDelegate <NSObject> //for binding view components to the model via the view controller

-(void)updateEntity:(id<Entity>)e;
-(void)hide:(BOOL)state Entity:(id<Entity>)e;
-(id<Entity>)addEntityOfType:(EntityType)type;
-(void)removeEntity:(id<Entity>)e;

@end

@interface EntityModel : NSObject <Entity, TengineDelegate>

//entity protocol
//tengine protocol
//poolable protocol

//delegate
@property(readwrite, nonatomic, retain) id<EntityModelControllerDelegate> controller;

//visitor
@property(readwrite, nonatomic, retain) id<UpdateModule> updater;

@property(readonly, nonatomic) float tOffset;
@property(readwrite, nonatomic) float speed;
@property(readwrite, nonatomic) BOOL isVisible;
@property(readonly, nonatomic) BOOL isAlive;

-(id)initWithType:(EntityType)t;



@end
